home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / earthlink / nscomm / java40.jar / sun / awt / macos / MFramePeer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-03  |  2.5 KB  |  138 lines

  1. package sun.awt.macos;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Event;
  6. import java.awt.Font;
  7. import java.awt.Frame;
  8. import java.awt.Image;
  9. import java.awt.MenuBar;
  10. import java.awt.Rectangle;
  11. import java.awt.Window;
  12. import java.awt.peer.FramePeer;
  13.  
  14. class MFramePeer extends MPanelPeer implements FramePeer {
  15.    boolean mFrameIsSecure;
  16.    boolean mFrameIsEmbedded;
  17.    boolean mIsWindow;
  18.  
  19.    MFramePeer(Frame var1) {
  20.       super(var1);
  21.       this.mIsWindow = false;
  22.       if (var1.getTitle() != null) {
  23.          this.setTitle(var1.getTitle());
  24.       }
  25.  
  26.       Font var2 = ((Component)var1).getFont();
  27.       if (var2 == null) {
  28.          var2 = new Font("Dialog", 0, 9);
  29.          ((Component)var1).setFont(var2);
  30.          ((MComponentPeer)this).setFont(var2);
  31.       }
  32.  
  33.       Color var3 = ((Component)var1).getBackground();
  34.       if (var3 == null) {
  35.          ((Component)var1).setBackground(Color.lightGray);
  36.          ((MComponentPeer)this).setBackground(Color.lightGray);
  37.       }
  38.  
  39.       var3 = ((Component)var1).getForeground();
  40.       if (var3 == null) {
  41.          ((Component)var1).setForeground(Color.black);
  42.          ((MComponentPeer)this).setForeground(Color.black);
  43.       }
  44.  
  45.       Image var4 = var1.getIconImage();
  46.       if (var4 != null) {
  47.          this.setIconImage(var4);
  48.       }
  49.  
  50.       this.setResizable(var1.isResizable());
  51.       Rectangle var5 = ((Component)var1).bounds();
  52.       this.reshape(var5.x, var5.y, var5.width, var5.height);
  53.    }
  54.  
  55.    MFramePeer(Window var1) {
  56.       super(var1);
  57.       this.mIsWindow = true;
  58.       Font var2 = ((Component)var1).getFont();
  59.       if (var2 == null) {
  60.          var2 = new Font("Dialog", 0, 9);
  61.          ((Component)var1).setFont(var2);
  62.          ((MComponentPeer)this).setFont(var2);
  63.       }
  64.  
  65.       Color var3 = ((Component)var1).getBackground();
  66.       if (var3 == null) {
  67.          ((Component)var1).setBackground(Color.lightGray);
  68.          ((MComponentPeer)this).setBackground(Color.lightGray);
  69.       }
  70.  
  71.       var3 = ((Component)var1).getForeground();
  72.       if (var3 == null) {
  73.          ((Component)var1).setForeground(Color.black);
  74.          ((MComponentPeer)this).setForeground(Color.black);
  75.       }
  76.  
  77.       this.setResizable(false);
  78.       Rectangle var4 = ((Component)var1).bounds();
  79.       this.reshape(var4.x, var4.y, var4.width, var4.height);
  80.    }
  81.  
  82.    native void create(MComponentPeer var1);
  83.  
  84.    public native void setTitle(String var1);
  85.  
  86.    public void show() {
  87.       super.show();
  88.       this.pShow();
  89.    }
  90.  
  91.    public void reshape(int var1, int var2, int var3, int var4) {
  92.       this.pReshape(var1, var2, var3, var4);
  93.    }
  94.  
  95.    public void setIconImage(Image var1) {
  96.    }
  97.  
  98.    public void setMenuBar(MenuBar var1) {
  99.    }
  100.  
  101.    public void setResizable(boolean var1) {
  102.    }
  103.  
  104.    public void setCursor(Image var1) {
  105.    }
  106.  
  107.    public void dispose() {
  108.       this.pDispose();
  109.    }
  110.  
  111.    private native void pReshape(int var1, int var2, int var3, int var4);
  112.  
  113.    private native void pDispose();
  114.  
  115.    private native void pShow();
  116.  
  117.    protected void handleFrameReshape(int var1, int var2, int var3, int var4) {
  118.       super.target.reshape(var1, var2, var3, var4);
  119.       super.target.invalidate();
  120.       super.target.validate();
  121.       super.target.repaint();
  122.    }
  123.  
  124.    protected void handleWindowClose() {
  125.       super.target.postEvent(new Event(super.target, 201, (Object)null));
  126.    }
  127.  
  128.    protected void handleWindowMoved(int var1, int var2) {
  129.       super.target.postEvent(new Event(super.target, 0L, 205, var1, var2, 0, 0));
  130.    }
  131.  
  132.    public native void toFront();
  133.  
  134.    public native void toBack();
  135.  
  136.    public native void setCursor(int var1);
  137. }
  138.